package com.itheima.chapter10.singleton;

/*
单例设计模式----饿汉式
 */
public class Demo {
    public static void main(String[] args) {
        Single1 s = Single1.getInstance();
        Single1 s1 = Single1.getInstance();
        System.out.println(s == s1);
    }
}

class Single1 {
    private Single1() {
    }

    private static Single1 s = new Single1();

    public static Single1 getInstance() {
        return s;
    }
}
